package com.eastjet.maintenance.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eastjet.maintenance.domain.TypePart;
import com.eastjet.maintenance.mapper.TypePartMapper;
import com.eastjet.maintenance.service.TypePartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨博文
 * @description 针对表【type_part(备件类型)】的数据库操作Service实现
 * @createDate 2024-11-25 09:23:39
 */
@Service
public class TypePartServiceImpl extends ServiceImpl<TypePartMapper, TypePart> implements TypePartService {

    @Autowired
    private TypePartMapper typePartMapper;// 注入TypePartMapper

    @Override
    public List<TypePart> SelectAllTypePart(TypePart typePart) {
        return typePartMapper.SelectAllTypePart(typePart);
    }

    @Override
    public List<TypePart> SelectAllTypePartByParentId(TypePart typePart) {
        return typePartMapper.SelectAllTypePartByParentId(typePart);
    }

    /*
    新增备件类型
     */
    @Override
    public Boolean InsertTypePart(TypePart typePart) {
        return this.save(typePart);
    }

    /*
    修改删除备件类型
     */
    @Override
    public Boolean UpdateTypePart(List<TypePart> typePart) {
        return this.updateBatchById(typePart);
    }
}




